package vcp.gui.forms;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import javax.swing.UIManager;
import javax.swing.LayoutStyle.ComponentPlacement;

/**
 * Check Out Form
 *
 */
public class CheckOutForm extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextField txtCID;
	private JTextField txtCARID;
	private JButton btnCheckOut;

	public JTextField getTxtCID() {
		return txtCID;
	}

	public void setTxtCID(JTextField txtCID) {
		this.txtCID = txtCID;
	}

	public JTextField getTxtCARID() {
		return txtCARID;
	}

	public void setTxtCARID(JTextField txtCARID) {
		this.txtCARID = txtCARID;
	}

	public JButton getBtnCheckOut() {
		return btnCheckOut;
	}

	public void setBtnCheckOut(JButton btnCheckOut) {
		this.btnCheckOut = btnCheckOut;
	}

	/**
	 * Create the panel.
	 */
	public CheckOutForm() {
		Color cgreen = Color.decode("#266A29");
		setBackground(cgreen);
		setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Customers Check Out", TitledBorder.LEADING, TitledBorder.TOP, null, Color.WHITE));
		
		JLabel lblCID = new JLabel("Customer ID");
		lblCID.setForeground(Color.WHITE);
		
		JLabel lblCARID = new JLabel("Car ID");
		lblCARID.setForeground(Color.WHITE);
		
		txtCID = new JTextField();
		txtCID.setColumns(10);
		
		txtCARID = new JTextField();
		txtCARID.setColumns(10);
		
		btnCheckOut = new JButton("check out");
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(12)
					.addComponent(lblCARID, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)
					.addGap(33)
					.addComponent(txtCARID, GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
					.addContainerGap())
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(12)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(89)
							.addComponent(txtCID, GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
							.addContainerGap())
						.addComponent(lblCID, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)))
				.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
					.addContainerGap(329, Short.MAX_VALUE)
					.addComponent(btnCheckOut, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
					.addContainerGap())
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(13)
							.addComponent(lblCID))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(10)
							.addComponent(txtCID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addGap(13)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblCARID)
						.addComponent(txtCARID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(btnCheckOut)
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
